package branice.spring.cloud.service;

import branice.spring.cloud.config.FeignConfiguration;
import branice.spring.cloud.constants.GlobalConstants;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(name = "nacos-consumer", fallback = SimpleFeignFallBack.class, configuration = FeignConfiguration.class)
public interface OpenFeignService {
    /**
     * 模拟发送请求
     *
     * @param body
     * @return
     */
    @PostMapping("/nacosClient/reciveReq")
    JSONObject sendReq(@RequestHeader(GlobalConstants.X_ID) String logId, @RequestBody String body);


}
